package exception_exercise;

public class FinallyDemo2 {
    public static void main(String[] args) {
        System.out.println("程序开始");
        try{
            //String line2=null;
            String line2="";
            System.out.println(line2.length());
            return;
        }catch (Exception e2){
            System.out.println("出现错误并解决了");
        }finally {
            System.out.println("finally中的代码执行了");
        }
        System.out.println("程序结束");
    }
}
